﻿Public Class AddReply_mobile
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Request.Params("Book_FK") = "" Or Request.Params("replyTo") = "" Then
            Response.Redirect("Default.aspx")
        End If
    End Sub

    Protected Sub DetailsView1_ItemInserted(sender As Object, e As DetailsViewInsertedEventArgs)
        Response.Redirect("BookDetails.aspx?ID=" + Request.Params("Book_FK"))
    End Sub

    Protected Sub DetailsView1_ItemCommand(sender As Object, e As DetailsViewCommandEventArgs)
        If e.CommandName = "Cancel" Then
            Response.Redirect("BookDetails.aspx?ID=" + Request.Params("Book_FK"))
        End If
    End Sub

    Protected Sub DetailsView1_ItemInserting(sender As Object, e As DetailsViewInsertEventArgs)
        'Add parameters to details view.
        e.Values.Add("Name", User.Identity.Name)
        e.Values.Add("Book_FK", Request.Params("Book_FK"))
    End Sub

End Class